<template>
  <div class="comment-container">
    <div class="comment-main">
        <div class="avatar avatar-type1">
          <img alt="avatar" :src="comment.user.avatar">
        </div>
        <div class="info">
          <div class="nickname">
            <span>{{comment.user.nickname}}</span>
<!--            <span v-if="comment.type === 3"> 回复 {{comment.to.nickname}}</span>-->
            <span class="star">
              <img v-for="(v,i) in comment.stars" src="@/assets/star.png" alt="star" :key="i">
            </span>
          </div>
          <div class="content">{{comment.content}}</div>
<!--          <div class="origin-comment" v-if="comment.type === 3">-->
<!--            <span>“{{comment.to.content}}”</span>-->
<!--          </div>-->
<!--          <div class="status">-->
<!--            <span class="like">{{comment.likeNum}}点赞</span>-->
<!--            <span class="comment">{{comment.commentNum}}评论</span>-->
<!--          </div>-->
<!--          <div class="children" v-if="comment.type === 1 && comment.children.length > 0">-->
<!--            <Comment v-for="item in comment.children" :key="item.id" :comment="item"></Comment>-->
<!--          </div>-->
        </div>
      </div>

  </div>
</template>

<script>
export default {
  name: "Comment",
  props: ['comment']
}
</script>

<style scoped lang="scss">

.comment-container {
  border-radius: 10px;
  padding: 20px;
}
.comment-main {
  display: flex;
}
.avatar {
  flex-shrink: 0;
  margin-right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  &.avatar-type1 {
    width: 40px;
    height: 40px;
  }
  img {
    object-fit: cover;
    width: 100%;
    height: 100%;
    border-radius: 50%;
  }
}
.star > img {
  &:first-child {
    margin-left: 10px;
  }
  width: 10px;
  height: 10px;
}
.info {
  > div {
    margin-bottom: 10px;
  }
  .content {

  }
  .origin-comment {
    padding: 10px;
    background: #f1f1f1;
  }
  .status {
    > span {
      font-size: 14px;
      margin-right: 5px;
    }
  }

}
</style>
